<?php

	class EventUser implements iModel {
		public $user;
		public $invitationUser;
		public $isUserManager;
		public $isUserConfirmed;
		public $userRegistrationCode;
		
		public function __construct() {
			$this->setUser(new User());
			$this->setInvitationUser(new User());
		}
		
		public function getUser() {
			 return $this->user; 
		}
		
		public function getInvitationUser() {
			 return $this->invitationUser; 
		}
		
		public function getIsUserManager() {
			 return $this->isUserManager; 
		} 
		
		public function getIsUserConfirmed() {
			 return $this->isUserConfirmed; 
		} 
		 
		public function getUserRegistrationCode() {
			 return $this->userRegistrationCode; 
		}
		
		public function setUser($user) {
			 $this->user = $user; 
		}		
		
		public function setInvitationUser($invitationUser) {
			 $this->invitationUser = $invitationUser; 
		}
		 
		public function setIsUserManager($isUserManager) {
			 $this->isUserManager = $isUserManager; 
		} 

		public function setIsUserConfirmed($isUserConfirmed) {
			 $this->isUserConfirmed = $isUserConfirmed; 
		}
		
		public function setUserRegistrationCode($userRegistrationCode) {
			 $this->userRegistrationCode = $userRegistrationCode; 
		}
		
		public function JSONToObject($eventUserJSON) {
			$user = new User();
			if ($eventUserJSON->user != null) {
				$this->setUser($user->JSONToObject($eventUserJSON->user));
			}
			else {
				$this->setUser($user);
			}
			
			$invitationUser = new User();
			if ($eventUserJSON->user != null) {
				$this->setInvitationUser($invitationUser->JSONToObject($eventUserJSON->invitationUser));
			}
			else {
				$this->setInvitationUser($invitationUser);
			}
			
			$this->setIsUserManager($eventUserJSON->isUserManager);
			$this->setIsUserConfirmed($eventUserJSON->isUserConfirmed);
			$this->setUserRegistrationCode($eventUserJSON->userRegistrationCode);
		}
	}

?>